<?php
/*=============================================================================
|| ##################################################################
||	phpFoX Konsort
|| ##################################################################
||
||	Copyright		: (C) 2005-2007 PHPFOX Limited a Reality Fox Creation
||	Contact			: info@phpfox.com
||
||	- phpFoX and all of its source code and files are protected by Copyright Laws.
||
||	- The license for phpFoX permits you to install this software on a single domain (.com, .org, .net, etc.).
||
||	- You may also not remove this copyright screen which shows the copyright information and credits for phpFoX (RealityFOX Creations).
||
||	- phpFoX Konsort is NOT a FREE software - http://www.phpfox.com/license/
||
|| ##################################################################
=============================================================================*/

/* $File: ./site/public/popup/emoteicons.php, $Author:  $ */

	$oTpl = &App::getTemplate();

    global $_CONF;
    $oReq = &App::getRequest();
    $sDir = opendir($_CONF['smile.path'].'emo/');
	$sEmotions = "";
	while ($sFile = readdir($sDir))
	{
		if (ereg("jpg",$sFile) || ereg("gif",$sFile))
		{
			$sName = str_replace(".jpg","",$sFile);
			$sName = str_replace(".gif","",$sName);
			$sEmotions .= '<a href="javascript:void(0);" onclick="insertAtCursor(opener.document.getElementById(\'maintext\'), \':'.$sName.':\',1)">'."\n";
			$sEmotions .= '<img src="'.$_CONF['smile.url'].'emo/'.$sFile.'" style="vertical-align:middle;padding:5px;" alt="" /></a> '."\n";
		}
	}
	$oTpl->assignSrc(array
	(
		'sEmotions' => $sEmotions,
		'tinymce_popup' => true,
		'tiny_mce' => true
	));
	$oTpl->assign('turnOnMCE', true);
    $oTpl->setTemplateFile('emoteicons.html');
?>